inertia_matrix=zeros(4,4,3);
Io=zeros(3,3,3);
Para_vec = XX %inertial_pi
for j = 1:5
    inertia_matrix(4,4,j) = Para_vec(10*(j-1)+1);
    
    inertia_matrix(4,1,j) = Para_vec(10*(j-1)+2);
    inertia_matrix(4,2,j) = Para_vec(10*(j-1)+3);
    inertia_matrix(4,3,j) = Para_vec(10*(j-1)+4);
    
    inertia_matrix(1,4,j) = Para_vec(10*(j-1)+2);
    inertia_matrix(2,4,j) = Para_vec(10*(j-1)+3);
    inertia_matrix(3,4,j) = Para_vec(10*(j-1)+4);
    
    Io(1:3,1:3,j)=[
     Para_vec(10*(j-1)+5) Para_vec(10*(j-1)+6) Para_vec(10*(j-1)+7);
     Para_vec(10*(j-1)+6) Para_vec(10*(j-1)+8) Para_vec(10*(j-1)+9);
     Para_vec(10*(j-1)+7) Para_vec(10*(j-1)+9) Para_vec(10*(j-1)+10);    
    ];
    
    inertia_matrix(1:3,1:3,j) = 0.5*trace(Io(1:3,1:3,j))*eye(3)-Io(1:3,1:3,j);
    
    det(inertia_matrix(:,:,j))
end